#Makefile for Distributed FIle System (CEID OS2 2009 project)
SERVER = dfs

# directories
u = /usr
i = $u/include
s = $i/sys
m = $i/minix
b = $i/ibm
k = $u/src/kernel
p = $u/src/servers/pm
f = $u/src/servers/fs
d = $u/src/servers/dfs

u = /usr
s = $u/sbin

# program,flags,etc.
CC = exec cc
CFLAGS = -I$i $(EXTRA_OPTS)
LDFLAGS = -i
LIBS = -lsys -lsysutil -ltimers
OBJ = main.o table.o dfs.o neighbours.o lfi.o cache.o

#build local binary
all build: $(SERVER)

$(SERVER): $(OBJ)
	$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
	install -S 512w $@

#install with other servers
install:	/usr/sbin/$(SERVER)
/usr/sbin/$(SERVER):	$(OBJ)
	install -o root -cs $? $@

#clean up local files
clean:
	rm -f $(SERVER) *.o *.bak

depend: 
	/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend

# Include generated dependencies.
include .depend


